package com.gitee.wsl.model.process.request

import com.gitee.wsl.flowing.pipeline.Pipeline
import com.gitee.wsl.flowing.pipeline.PipelinePhase

/**
 * An [HttpClient]'s pipeline used for sending [ProcessRequest] to a remote server.
 */
class SendPipeline(
    override val developmentMode: Boolean = true
) : Pipeline<Any, ProcessRequestBuilder>(Before, State, Monitoring, Engine, Receive) {

     companion object Phases {
        /**
         * The earliest phase that happens before any other.
         */
         val Before: PipelinePhase = PipelinePhase("Before")

        /**
         * Use this phase to modify request with a shared state.
         */
         val State: PipelinePhase = PipelinePhase("State")

        /**
         * Use this phase for logging and other actions that don't modify a request or shared data.
         */
         val Monitoring: PipelinePhase = PipelinePhase("Monitoring")

        /**
         * Send a request to a remote server.
         */
         val Engine: PipelinePhase = PipelinePhase("Engine")

        /**
         * Receive a pipeline execution phase.
         */
         val Receive: PipelinePhase = PipelinePhase("Receive")
    }
}